/* jsx ctrl+m*/
import React, { Component } from 'react';
import './css/index.css'
import Item from './components/item'
import axios from 'axios'
class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      playlists: []
    }
  }
  render() {
    return (
      <div className="item">
        <Item playlists={this.state.playlists} alent={this.popup}></Item>
      </div>
    );
  }
  popup(id) {
    alert(`${id}`)
  }
  componentDidMount() {
    axios.get('http://122.112.161.135:3000/top/playlist?cat=华语').then(res => {
      this.setState({
        playlists: res.data.playlists
      })

    })
  }
}
export default App;


